﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Assets.AnimationPlayer.Scripts.Util;
using UnityEngine;
using UnityEngine.UI;

namespace Assets.AnimationPlayer.Scripts.UI.controls
{
    public class TopBarControl:MonoBehaviour
    {
        public GameObject BtnBack;
        public Image LogoWhite;
        public Image LogoColor;
        public Image LogoAll;

        private YioksCallBack.CallBackFun _callBackClick;
        public void BindEvents(YioksCallBack.CallBackFun callBack)
        {
            _callBackClick = callBack;
            YioksTriggerListener.Get(BtnBack).OnClick = delegate {
                _callBackClick();
            };
        }

        public void ShowLogo(LogoColorType type)
        {
            switch (type)
            {
                case LogoColorType.White:
                    LogoWhite.gameObject.SetActive(true);
                    LogoColor.gameObject.SetActive(false);
                    LogoAll.gameObject.SetActive(false);
                    break;
                case LogoColorType.Color:
                    LogoWhite.gameObject.SetActive(false);
                    LogoColor.gameObject.SetActive(true);
                    LogoAll.gameObject.SetActive(false);
                    break;
                case LogoColorType.All:
                    LogoWhite.gameObject.SetActive(false);
                    LogoColor.gameObject.SetActive(false);
                    LogoAll.gameObject.SetActive(true);
                    break;
            }
        }
    }
}
